AM_CFLAGS = -Wall -Werror -g

bin_PROGRAMS = mtcprstat mtcprstat-static
mtcprstat_SOURCES = mtcprstat.h mtcprstat.c functions.h functions.c capture.h \
	capture.c process-packet.h process-packet.c local-addresses.h \
	local-addresses.c stats.h stats.c output.h output.c stats-hash.h \
	stats-hash.c
mtcprstat_static_SOURCES = $(mtcprstat_SOURCES)

if BUILD_PCAP
mtcprstat_CFLAGS = $(AM_CFLAGS) -pthread -I$(top_srcdir)/@LIBPCAP_SUBDIR@
mtcprstat_LDFLAGS = $(AM_LDFLAGS) -L$(top_srcdir)/@LIBPCAP_SUBDIR@ -lpthread
mtcprstat_LDADD = -lpcap

mtcprstat_static_CFLAGS = $(AM_CFLAGS) -pthread -I$(top_srcdir)/@LIBPCAP_SUBDIR@
mtcprstat_static_LDFLAGS = $(AM_LDFLAGS) -static -L$(top_srcdir)/@LIBPCAP_SUBDIR@
mtcprstat_static_LDADD = -lpthread -lpcap

else
mtcprstat_CFLAGS = $(AM_CFLAGS) -pthread
mtcprstat_LDFLAGS = $(AM_LDFLAGS) -lpthread -lpcap

mtcprstat_static_CFLAGS = $(AM_CFLAGS) -pthread
mtcprstat_static_LDFLAGS = $(AM_LDFLAGS) -static
mtcprstat_static_LDADD = -lpthread -lpcap

endif